#!/usr/bin/env python
#coding:utf-8
import sys

s = ['a', 2, 3, 'b']

def test(lists):
    while True:
        c = raw_input('请输入一个列表序号(q退出):').strip()
        if c.lower() == 'q':
            sys.exit()
        elif int(c) not in range(len(lists)):
            print '所输内容不在列表序号之内'
            continue
        else:
            l = lists[int(c)]
        return l

while True:
    print test(s)
